---
apiVersion: v1
kind: DeploymentConfig
metadata:
  name: mdapi
  labels:
    app: mdapi
    service: mdapi
spec:
  replicas: 2
  selector:
    app: mdapi
    service: mdapi
  template:
    metadata:
      labels:
        app: mdapi
        service: mdapi
    spec:
      containers:
      - name: mdapi
        image: registry/mdapi:latest
        ports:
        - containerPort: 8080
        volumeMounts:
          - name: config-volume
            mountPath: /etc/mdapi/
            readOnly: true
          - name: data-volume
            mountPath: /var/tmp/
        readinessProbe:
          timeoutSeconds: 5
          initialDelaySeconds: 60
          periodSeconds: 60
          httpGet:
            path: /
            port: 8080
        livenessProbe:
          timeoutSeconds: 15
          initialDelaySeconds: 60
          periodSeconds: 60
          httpGet:
            path: /
            port: 8080
        resources:
      volumes:
       - name: config-volume
         configMap:
           name: mdapi-configmap
       - name: data-volume
         persistentVolumeClaim:
           claimName: mdapi-storage
  triggers:
  - type: ImageChange
    imageChangeParams:
      automatic: true
      containerNames:
      - "mdapi"
      from:
        kind: ImageStreamTag
        name: mdapi:latest
